package com.definity.toolkit.web.util;

import java.util.Locale;

public class WebUtils {

	public static Locale getLocale(String lang) {
		Locale locale = Locale.ENGLISH;
		
		if (lang != null) {
			if (lang.indexOf("_") > -1) {
				String[] split = lang.split("_");
				locale = new Locale(split[0], split[1]);
			} else {
				locale = new Locale(lang);
			}
		}
		
		return locale;
	}
	
}
